package 链表反转;

import util.ListNode;



public class reserveList {
    public static void main(String[] args) {
        String st1 = "123";
        String st2 = "123";
        String st3 = new String("123");
        String st4 = new String("123");
        System.out.println(st1 == st2);
        System.out.println(st3 == st4);
    }

    public static ListNode reverseList(ListNode head){
        if (head == null || head.next ==null){
            return head;
        }

        ListNode cur = reverseList(head.next);

        head.next.next = head;
        head.next = null;

        return cur;
    }
}